﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateVSToolWindow" xmlns="http://schemas.microsoft.com/pag/gax-core"
                               xmlns:xi="http://www.w3.org/2001/XInclude" Bound="false">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="VS Tool Windows general" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/252f7b99-b44a-4a63-88d9-3a0ca48ac4f1.htm" />
    <Link Kind="Documentation" Caption="How to: Create a Tool Window " Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/1e96cf07-bde4-445b-bcd0-48cadb351dde.htm" />
    <Link Kind="Documentation" Caption="How to: Register a Tool Window" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/8c8c4a24-3da4-497b-9db2-0ddd7cfbfdd2.htm" />
  </DocumentationLinks>
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>VS Tool Window</Caption>
  <Description>VS Tool Window</Description>
  <HostData>
    <Icon ID="3816" />
    <CommandBar Menu="VSSDKAssistProjectCreate"/>
  </HostData>
  <Arguments>
    <xi:include href="../Common/CommonArguments.xml"
					  xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />
    <Argument Name="VSPackageProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.CurrentlySelectedProjectValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="VSPackageProjectNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Properties.Item('DefaultNamespace').Value.ToString())"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>
    <Argument Name="DestinationFolder" Required="true">
      <ValueProvider Type="Evaluator" 
                     Expression="ToolWindows" 
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ToolWindowNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProjectNamespace).$(DestinationFolder)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="VSPackageProjectNamespace"/>
        <MonitorArgument Name="DestinationFolder"/>        
      </ValueProvider>
    </Argument>
    <Argument Name="ToolWindowGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.GuidValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ToolWindowName" Required="true">
      <Converter Type="VSSDKAssist.Assets.Converters.CSharpIdentifierConverter, VSSDKAssist.Assets"/>
    </Argument>
    <Argument Name="ToolWindowControlName" Required="true">
      <Converter Type="VSSDKAssist.Assets.Converters.CSharpIdentifierConverter, VSSDKAssist.Assets"/>
    </Argument>
    <Argument Name="ToolWindowClassFileName">
      <ValueProvider Type="Evaluator" 
                     Expression="$(ToolWindowName).cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ToolWindowName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ToolWindowControlClassFileName">
      <ValueProvider Type="Evaluator"
                     Expression="$(ToolWindowControlName).cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ToolWindowControlName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="ToolWindowControlDesignerClassFileName">
      <ValueProvider Type="Evaluator" 
                     Expression="$(ToolWindowControlName).Designer.cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="ToolWindowControlName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="VSPackageCodeClass" Type="EnvDTE.CodeClass, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.VSPackageCodeClassValueProvider, VSSDKAssist" 
                     Stage="OnBeginRecipe"/>
    </Argument>    
    <Argument Name="WindowGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <Converter Type="VSSDKAssist.Recipes.Common.Converters.WindowGuidConverter, VSSDKAssist"/>
    </Argument>
    <Argument Name="DockStyle" Type="Microsoft.VisualStudio.Shell.VsDockStyle, Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.DefaultDockStyleValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="Orientation" Type="Microsoft.VisualStudio.Shell.ToolWindowOrientation, Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.DefaultOrientationValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="MultiInstances" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator" 
                     Expression="false" 
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="Transient" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator" 
                     Expression="true" 
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="UIContextGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <Converter Type="VSSDKAssist.Recipes.Common.Converters.UIContextGuidConverter, VSSDKAssist"/>
    </Argument>
    <Argument Name="ToolWindowCaption" Required="true"/>
    <Argument Name="BitmapResourceId" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.RandomNumberValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ResxProjectItem" Type="EnvDTE.ProjectItem, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider
        Type="VSSDKAssist.Recipes.Common.ValueProviders.VSPackageResxProjectItemValueProvider, VSSDKAssist"
        VSPackageCodeClassArgument="VSPackageCodeClass" />
    </Argument>
    <Argument Name="BitmapDestinationFolder" Type="EnvDTE.ProjectItem, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.ResourcesFolderValueProvider, VSSDKAssist"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="BitmapFileName" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.EmptyBitmapValueProvider, VSSDKAssist"
                     ImageSize="Size16x16"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="SubscribeToWindowFrameEvents" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="false"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="SelectionTrackingSupport" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="false"
                     Stage="OnBeginRecipe"/>
    </Argument>    
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="VSSDKAssist.Recipes.CreateVSToolWindow.CreateVSToolWindowCP1, VSSDKAssist"
              Height="200" Width="510">
          <Title>Specify tool window general properties</Title>
          <LinkTitle>Tool window general properties</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.CreateVSToolWindow.CreateVSToolWindowCP2, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify tool window UI properties 1</Title>
          <LinkTitle>Tool window UI properties 1</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.CreateVSToolWindow.CreateVSToolWindowCP3, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify tool window UI properties 2</Title>
          <LinkTitle>Tool window UI properties 2</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.CreateVSToolWindow.CreateVSToolWindowCP4, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify tool window behavior</Title>
          <LinkTitle>Tool window behavior</LinkTitle>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="VSSDKAssist.Recipes.Common.Coordinators.ExecutionProgressCoordinator, VSSDKAssist">
    <!--Create Folder-->
    <Action Name="GenerateDestinationFolder"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddProjectFolderAction, VSSDKAssist.Assets"
          StatusMessage="Creating destination folder"
          WriteMessageToOutputWindow="true">
      <Input Name="FolderName" RecipeArgument="DestinationFolder"/>
      <Output Name="FolderAdded" />
    </Action> 
    <!--Add Bitmap File-->
    <Action Name="AddBitmapFile" Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromFileToProjectItemAction, VSSDKAssist.Assets"
            Open="false"
            StatusMessage="Adding bitmap file"
            WriteMessageToOutputWindow="true">
      <Input Name="SourceFileName" RecipeArgument="BitmapFileName"/>
      <Input Name="InputProjectItem" RecipeArgument="BitmapDestinationFolder"/>
      <Output Name="ProjectItem" />
    </Action>
    <!-- Update Resx -->
    <Action Name="UpdateResx" Type="VSSDKAssist.Recipes.Common.Actions.AppendBitmapResxEntryAction, VSSDKAssist"
            StatusMessage="Updating resource file"
            WriteMessageToOutputWindow="true">
      <Input Name="ResxProjectItem" RecipeArgument="ResxProjectItem"/>
      <Input Name="BitmapProjectItem" ActionOutput="AddBitmapFile.ProjectItem"/>
      <Input Name="BitmapResourceId" RecipeArgument="BitmapResourceId"/>
    </Action>
    <!--Create ToolWindow-->
    <Action Name="GenerateToolWindowContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\VSToolWindow\ToolWindow.tt"
          StatusMessage="Creating toolwindow class"
          WriteMessageToOutputWindow="true">
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>
      <Input Name="ToolWindowGuid" RecipeArgument="ToolWindowGuid"/>
      <Input Name="ToolWindowName" RecipeArgument="ToolWindowName"/>
      <Input Name="ToolWindowControlName" RecipeArgument="ToolWindowControlName"/>
      <Input Name="ToolWindowCaption" RecipeArgument="ToolWindowCaption"/>
      <Input Name="BitmapResourceId" RecipeArgument="BitmapResourceId"/>
      <Input Name="SubscribeToWindowFrameEvents" RecipeArgument="SubscribeToWindowFrameEvents"/>
      <Input Name="SelectionTrackingSupport" RecipeArgument="SelectionTrackingSupport"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddToolWindowContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateToolWindowContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ToolWindowClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
    </Action>
    <!--Create ToolWindowControl-->
    <Action Name="GenerateToolWindowControlContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\VSToolWindow\ToolWindowControl.tt"
          StatusMessage="Creating toolwindow control class"
          WriteMessageToOutputWindow="true">
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>
      <Input Name="ToolWindowControlName" RecipeArgument="ToolWindowControlName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddToolWindowControlContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateToolWindowControlContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ToolWindowControlClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
      <Output Name="ProjectItem" />
    </Action>
    <!--Create ToolWindowControlDesigner-->
    <Action Name="GenerateToolWindowControlDesignerContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\VSToolWindow\ToolWindowControlDesigner.tt"
          StatusMessage="Creating toolwindow control designer class"
          WriteMessageToOutputWindow="true">
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>
      <Input Name="ToolWindowControlName" RecipeArgument="ToolWindowControlName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddToolWindowControlDesignerContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateToolWindowControlDesignerContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="ToolWindowControlDesignerClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="AddToolWindowControlContent.ProjectItem" />
    </Action>
    <!--Add ProvideToolWindow attribute-->
    <Action Name="AddProvideToolWindowAttribute"
          Type="VSSDKAssist.Recipes.CreateVSToolWindow.AddProvideToolWindowAttributeAction, VSSDKAssist"
          StatusMessage="Adding toolwindow registration information"
          WriteMessageToOutputWindow="true">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="ToolWindowName" RecipeArgument="ToolWindowName"/>
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>      
      <Input Name="WindowGuid" RecipeArgument="WindowGuid"/>
      <Input Name="DockStyle" RecipeArgument="DockStyle"/>
      <Input Name="Orientation" RecipeArgument="Orientation"/>
      <Input Name="MultiInstances" RecipeArgument="MultiInstances"/>
      <Input Name="Transient" RecipeArgument="Transient"/>
    </Action>
    <!--Add ProvideToolWindowVisibility attribute-->
    <Action Name="AddProvideToolWindowVisibilityAttribute"
          Type="VSSDKAssist.Recipes.CreateVSToolWindow.AddProvideToolWindowVisibilityAttributeAction, VSSDKAssist">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="ToolWindowName" RecipeArgument="ToolWindowName"/>
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>
      <Input Name="UIContextGuid" RecipeArgument="UIContextGuid"/>
    </Action>
    <!--Add ShowToolwindow-->
    <Action Name="GenerateShowToolwindow"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\VSToolWindow\ShowToolWindow.tt">
      <Input Name="ToolWindowName" RecipeArgument="ToolWindowName"/>
      <Input Name="ToolWindowNamespace" RecipeArgument="ToolWindowNamespace"/>
      <Output Name="Content" />
    </Action>
    <Action Name="InsertShowToolwindow" Type="VSSDKAssist.Assets.Actions.VisualStudio.InsertTextToCodeElementAction, VSSDKAssist.Assets">
      <Input Name="TextToInsert" ActionOutput="GenerateShowToolwindow.Content" />
      <Input Name="CodeElement" RecipeArgument="VSPackageCodeClass" />
    </Action>    
  </Actions>
</Recipe>